package com.wyvoid.core.persistent.hibernate;

/**
 * User: cjp
 * Date: 2006-5-2
 * Time: 20:44:36
 */

import org.hibernate.criterion.Criterion;

import java.io.Serializable;
import java.util.List;

import com.wyvoid.core.persistent.Pagination;


public interface IHibernateDAO<T> {

    public T getById(Serializable id);

    public void save(T po);

    public void delete(T po);

    public List<T> findAll();

    public List<T> findByCriterion(Criterion... criterion);

    public void create(T po);

    public void update(T po);

    HibernatePage<T> doQuery(String hql, boolean cacheable, int curPage, int pageSize, Object... values);

    void executeHsql(String hql, Object... values);

    void deleteById(Serializable id);

    HibernatePage<T> doQuery(String hql, boolean cacheable, Pagination pagination, Object... values);

    T doQueryUnique(String hql, Object... values);

    T doQueryFirst(String hql, Object... values);

    List<T> doQueryList(String hql, boolean cacheable, Object... values);

    String getFromHql();

    long doQueryCount(String hql, Object... values);

    List<T> doQueryLimitList(String hql, boolean cacheable, int dataNum, Object...values);
}
